﻿@using Presentation.Web.Admin
@model Domain.Dto.MvcActionDto
@{
    ViewBag.subtitle = "编辑权限" + ((Model != null && Model.Name != null) ? "--" + Model.Name : "");
    ViewBag.title = "编辑权限" + ((Model != null && Model.Name != null) ? "--" + Model.Name : "");
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jshelper.js")" type="text/javascript"></script>
@using (Ajax.BeginForm("inedit", "permission", new AjaxOptions
    {
        OnSuccess = "AjaxOptionsEditSuccess",
        OnFailure = "AjaxOptionsEditFailure",
        HttpMethod = "post"
    }, new { @class = "" }))
{
    @Html.ValidationSummary(true)
    <fieldset class="module width_full">
        <div class="editor-label">
            <label>
                权限分类名
            </label>
        </div>
        <div class="editor-field">
            <select id="ClassId" name="ClassId">
                <option value="0">----请选择----</option>
                @{
    foreach (var item in ViewBag.actionclasslist)
    {
                    <option value="@(item.Id)"  @(item.Id == Model.ClassId ? "selected='selected'" : "")   >@(item.Name)</option>
    }
                }
            </select>
        </div>
        <div class="editor-label">
            <label>
                所属控制器名
            </label>
        </div>
        <div class="editor-field">
            <input  id = "ControllerName" name = "ControllerName" type ="text" class = "text-box single-line" value = "@(ViewBag.controllername)" readonly = "readonly"/>
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.TextBox("Name", Model.Name, new { @readonly = "readonly" })
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Remark)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Remark)
            @Html.ValidationMessageFor(model => model.Remark)
        </div>
        <div style="display: none;">
            @Html.HiddenFor(model => model.Id)
            @Html.HiddenFor(model => model.SortNum)
            @Html.HiddenFor(model => model.State)
            @Html.HiddenFor(model => model.ControllerId)
            @Html.HiddenFor(model => model.AddTime)
            @Html.HiddenFor(model => model.IpAddress)
        </div>
    </fieldset>
    <p>
        @{
    if (Html.HasUiPermission(this.ViewContext, "InEdit"))
    {
            <input type="submit" value="修改" class="alt_btn module_margin" />@Html.GoBackPre("t-button")
    }
        }
    </p>
}
